<!DOCTYPE html>

<html lang="zh-cn" xmlns:th="http://www.thymeleaf.org/">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>注册管理</title>
    <!-- Bootstrap JQ核心CSS 、JS-->
    <script src="/static/jquery/3.5.1/jquery.min.js" type="text/javascript"></script>
    <link href="/static/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/bootstrap/3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="/static/linling-core-tools/js/linling-core-tools.js" type="text/javascript"></script>
    <!-- 适用于Surface /台式机Windows 8错误的IE10视口黑客 -->
    <script src="/static/linling-core-tools/js/ie10-viewport-bug-workaround.js" type="text/javascript"></script>
    <link href="/static/linling-core-tools/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <script type="text/javascript">
        function renew() {
            let open = $("#open").children('option:selected').val()
            location.href = "/wtr/register/open?open=" + open;
        }

        function add() {
            location.href = "/wtr/register/add";
        }
    </script>
</head>
<body>
<h1 class="page-header">注册管理</h1>
<span>注册状态：</span>
<label for="open" class="form-inline">
    <select class="bootstrap-select form-control" data-style="btn-info" id="open" name="open">
        <option value="false" th:value="${rc.isOpen()}" th:text="'当前：'+${rc.isOpen()}">默认关闭</option>
        <option value="false">关闭注册</option>
        <option value="true">开放注册</option>
    </select>
</label>
<button id="reset" class="btn btn-danger" onclick="renew()">
    <span class="glyphicon glyphicon-repeat"></span> 修改状态
</button>&nbsp;
<button class="btn btn-success" onclick="add()">
    <span class="glyphicon glyphicon-plus"></span> 添加邀请码
</button>&nbsp;
<div class="table-responsive">
    <table id="listCustomer" class="table table-striped">
        <thead>
        <tr>
            <th>邀请码</th>
            <th>部门</th>
            <th>职务</th>
            <th>添加者</th>
            <th>添加时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="searchVar">
        <!-- 预留数据 -->
        <tr th:each="code:${rc.getInvitationCode()}">
            <td th:text="${code.getCode()}"></td>
            <td th:text="${code.getDepartment()}"></td>
            <td th:text="${code.getOffice()}"></td>
            <td th:text="${code.getName()}"></td>
            <td th:text="${code.getDateTime()}"></td>
            <td><p><a href="#" th:href="'/wtr/register/del/'+${code.getCode()}">删除</a></p></td>
        </tr>
        </tbody>
        <tfoot>
        <!-- 尾部数据 -->
        <tr></tr>
        </tfoot>
    </table>
</div>
</body>
</html>